#ifndef WIDGET_H
#define WIDGET_H

#include <QWidget>
#include <QProcess>

namespace Ui {
class Widget;
}

class QTimer;
class Widget : public QWidget
{
    Q_OBJECT

public:
    explicit Widget(QWidget *parent = 0);
    ~Widget();

private slots:
    void searchForMjpgSreamer();
    void loadVideoDevices();
    void start();
    void stop();
    // for _mjpgRunner
    void onError(QProcess::ProcessError error);
    void onFinished(int exitCode, QProcess::ExitStatus exitStatus);
    void onReadyReadStandardError();
    void onReadyReadStandardOutput();
    void onStarted();
    void onTimeout();
    void on_openCloseBtn_clicked();
    void on_quitBtn_clicked();

private:
    Ui::Widget *ui;
    QString _mjpgStreamerPath;
    QProcess *_mjpgRunner;
    QTimer *_timer;
};

#endif // WIDGET_H
